package avicit.bdp.oss.utils.upload.entity;

/**
 * @金航数码科技有限责任公司
 * @作者：developer
 * @邮箱：developer@avic-digital.com
 * @创建时间： 2020-12-09
 * @类说明：UploadChunkDto
 * @修改记录：
 * @注意事项：
 * @主要功能：OSS对象存储任务管理模块，上传分片元数据
 */
public class UploadChunkDto {
    /**
     * 桶名称
     */
    private String bucketName;

    /**
     * 前缀
     */
    private String prefix;

    /**
     * 对象名称
     */
    private String objectName;

    /**
     * 分片编号
     */
    private int chunkNo;

    /**
     * task任务ID
     */
    private String taskId;

    /**
     * 无参构造函数
     */
    public UploadChunkDto() {
    }

    /**
     * 有参构造函数
     * @param bucketName
     * @param prefix
     * @param objectName
     * @param chunkNo
     * @param taskId
     */
    public UploadChunkDto(String bucketName, String prefix, String objectName, int chunkNo, String taskId) {
        this.bucketName = bucketName;
        this.prefix = prefix;
        this.objectName = objectName;
        this.chunkNo = chunkNo;
        this.taskId = taskId;
    }

    public String getBucketName() {
        return bucketName;
    }

    public String getPrefix() {
        return prefix;
    }

    public String getObjectName() {
        return objectName;
    }

    public int getChunkNo() {
        return chunkNo;
    }

    public String getTaskId() {
        return taskId;
    }

    public static UploadChunkDto.Builder builder() {
        return new UploadChunkDto.Builder();
    }

    public static final class Builder {
        private String bucketName;
        private String prefix;
        private String objectName;
        private int chunkNo;
        private String taskId;

        public Builder bucketName(String bucketName) {
            this.bucketName = bucketName;
            return this;
        }

        public Builder prefix(String prefix) {
            this.prefix = prefix;
            return this;
        }

        public Builder objectName(String objectName) {
            this.objectName = objectName;
            return this;
        }

        public Builder chunkNo(int chunkNo) {
            this.chunkNo = chunkNo;
            return this;
        }

        public Builder taskId(String taskId) {
            this.taskId = taskId;
            return this;
        }

        public UploadChunkDto build() {
            return new UploadChunkDto(bucketName, prefix, objectName, chunkNo, taskId);
        }
    }
}
